<?php

namespace app\serveruser\traits;

trait addAppId
{
	/**
	 * @author:      李颖
	 * @DateTime:    2017-07-21 16:09:21
	 * @Description: 使用场景： 若app_id为总后台，则在进行操作分类时，不加app_id的where条件
	 */
	private function _addAppId(array $where = [], int $app_id): array 
	{
		$manageAppId = \app\manage\service\ApiBase::getAppId();
		$manageAppId != $app_id && $where['app_id'] = $app_id;
		return $where;
	}

	/*判断是不是总后台app_id*/
	private function _isManageAppId(int $app_id): bool 
	{
		$manageAppId = \app\manage\service\ApiBase::getAppId();
		if($manageAppId == $app_id){
			return true;
		}else{
			return false;
		}
	}

}